I keep on getting the same error. I'm using VSC++6.0 to run it. Says randomize, clrscr, random are all undeclared identifiers
I keep on getting the same error. I'm using VSC++6.0 to run it. Says randomize, clrscr, random are all undeclared identifiers
Yeah, that's because they're not in MSVC++. 'randomize' if I recall correctly is a Borland function. Furthermore, 'clrscr' and 'random' are also. Either that, or you simply aren't including the correct header. However, if I remember correctly, those are Borland functions.
#include <time.h>
#include <stdio.h>
void randomize( void ) { srand( time(0) ); }
There. Now you have a 'randomize' function. As for 'random', use 'rand'.
x = rand() % 10; //produce a number from 0 to 9.
Don't even ask about clearing the screen. Read the FAQ. This is the problem with using non-ansi functions.
Quzah.
Hope is the first step on the road to disappointment.